<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <style>
    .box {
      width: 100px;
      height: 100px;
    }
    .box1 {
      background-color: skyblue;
      /*
          opacity的值不为1时，会创建层叠上下文
          即opacity:0.7时，.box1会在.box2的上面显示
          */
      opacity: 0.7;
    }
    .box2 {
      background-color: pink;
      margin-top: -50px;
      margin-left: 30px;
    }
  </style>
  <body>
    <div class="box box1"></div>
    <div class="box box2"></div>
  </body>
</html>
